const baseServe = 'http://61.183.117.29:18202/'
function commonAjax(urls,type,data,callback){
    let handleType="GET";
    if(type.toUpperCase()=="POST"){
        handleType="POST";
    }
    vm.$commonAjax(handleType,urls,data,callback,function(edata){
        console.log("返回失败！"+`${urls}`)
        console.log(edata)
      },function(comdata){
      },true)
}
//获取事故案例的列表
export function getListofcases(data,callback) {
    let url = `gemp/gemp-app/api/gemp/app/extend/knowledge/case/list/v1`
    let urls = `${baseServe}${url}`;
    commonAjax(urls,"POST",JSON.stringify(data),callback);
}
//获取事故案例的列表 根据机构ID获取详情
export function queryListofcases(data,callback) {
    let url = `gemp/gemp-app/api/gemp/app/extend/knowledge/case/id/v1`
    let urls = `${baseServe}${url}`;
    commonAjax(urls,"POST",data,callback);
}
//获取公文的列表
export function queryDocumentList(data,callback) {
    let url = `gemp/gemp-app/api/gemp/app/duty/document/list/v1`
    let urls = `${baseServe}${url}`;
    commonAjax(urls,"POST",JSON.stringify(data),callback);
}
//获取公文的列表详情
export function queryDocumentListDetails(data,callback) {
    let url = `gemp/gemp-app/api/gemp/app/duty/document/doucmentinfo/detail/v1`
    let urls = `${baseServe}${url}`;
    urls=urls+"?dutyType="+data.dutyType+"&publicId="+data.publicId;
    commonAjax(urls,"POST",{},callback);
}
